#include "threadmodel.h"

ThreadModel::ThreadModel(const Wishmaster::ThreadPtr& thread, QObject *parent) :
	QAbstractItemModel(parent),
	m_thread(thread)
{
}

int ThreadModel::attachmentRole(int attach) const
{
	int role = AttachmentBase + attach;
	if(role > MaxAttachment)
		return 0;
	return role;
}

int ThreadModel::attachmentLinkRole(int attach) const
{
	int role = AttachmentLinkBase + attach;
	if(role > MaxAttachmentLink)
		return 0;
	return role;
}

int ThreadModel::attachmentThumbRole(int attach) const
{
	int role = AttachmentThumbBase + attach;
	if(role > MaxAttachmentThumb)
		return 0;
	return role;
}

int ThreadModel::attachmentThumbLinkRole(int attach) const
{
	int role = AttachmentThumbLinkBase + attach;
	if(role > MaxAttachmentThumbLink)
		return 0;
	return role;
}
